Summary
Backpressure tells producers to slow down. Queue buffering absorbs bursts by storing work temporarily.
Interview Points
- Backpressure prevents overload by propagating capacity signals upstream.
- Queues smooth spikes but can hide overload and increase latency.
- Bounded queues are safer than unbounded queues.
- Monitor queue depth, age, processing rate, and dead-letter volume.
- Combine both: buffer short bursts, apply backpressure when buffers approach limits.
2-3 Minute Interview Script
“Queue buffering and backpressure are related but not the same. A queue absorbs a burst by storing work. Backpressure tells the producer to slow down because the consumer cannot keep up.
Queues are useful for smoothing traffic and decoupling producers from consumers, but unbounded queues are dangerous. They can turn an overload into memory pressure and very high latency.
In a robust design, I use bounded queues, monitor queue age and depth, and define what happens when capacity is exhausted. That could be rejecting work, slowing producers, shedding low-priority requests, or scaling consumers.
My interview line would be: queues buy time, backpressure protects the system.”
Follow-Ups
- Why is queue age often better than queue depth?
- What happens when the queue is full?